﻿// author: Susana Messias nº 6046

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Interface
{
    public partial class Form1 : Form
    {
        Statistics statistics;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Dispose(true);
        }


        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.statistics = new Statistics();
            this.statistics.getDatabase();
            this.comboBox1.Items.AddRange(this.statistics.getEstablishmentList().ToArray());
            this.comboBox2.Items.AddRange(this.statistics.getEstablishmentList().ToArray());
            this.comboBox3.Items.AddRange(this.statistics.getDegreeList().ToArray());
        }

        private void nToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }


        private void button1_Click(object sender, EventArgs e)
        {
            int establishmentIndex = this.comboBox1.SelectedIndex;
            string establishment = this.statistics.getEstablishmentList()[establishmentIndex];
            this.statistics.establishment(establishment);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int establishmentIndex = this.comboBox2.SelectedIndex;
            string establishment = this.statistics.getEstablishmentList()[establishmentIndex];
            int degreeIndex = this.comboBox3.SelectedIndex;
            string degree = this.statistics.getDegreeList()[degreeIndex];
            this.statistics.establishment(establishment, degree);
        }


       
    }
}
